package ac.svn.accesscontrol.ui.helper;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import ac.svn.accesscontrol.store.ISVNIdentifier;
import ac.svn.accesscontrol.utils.Utility;

/***
 * Class handles mouse over and mouse exit event for toolbar buttons.
 * @author Enigmanic
 *
 */
public class ToolbarTitleChangeListener extends MouseAdapter implements ISVNIdentifier
{
	
	private String defaultTitle = "";
	private String mouseOverTitle = "";

	public ToolbarTitleChangeListener(String defaultTitle, String mouseOverTitle) 
	{
		super();
		this.defaultTitle = defaultTitle;
		this.mouseOverTitle = mouseOverTitle;
	}


	@Override
	public void mouseEntered(MouseEvent arg0) {
		Utility.sendNotification(CMD_TOOLBAR_TITLE, mouseOverTitle);
	}

	@Override
	public void mouseExited(MouseEvent arg0) {
		Utility.sendNotification(CMD_TOOLBAR_TITLE, defaultTitle);			
	}
}

